import request from '@/config/axios'

// 微信菜单和角色关联 VO
export interface RoleWeixinMenuVO {
  id: number // 自增编号
  roleId: number // 角色ID
  weixinMenuId: number // 菜单ID
}

// 微信菜单和角色关联 API
export const RoleWeixinMenuApi = {
  // 查询微信菜单和角色关联分页
  getRoleWeixinMenuPage: async (params: any) => {
    return await request.get({ url: `/system/role-weixin-menu/page`, params })
  },

  getRoleWeixinMenuList: async (params: any) => {
    return await request.get({ url: `/system/role-weixin-menu/list`, params })
  },

  // 查询微信菜单和角色关联详情
  getRoleWeixinMenu: async (id: number) => {
    return await request.get({ url: `/system/role-weixin-menu/get?id=` + id })
  },

  // 新增微信菜单和角色关联
  createRoleWeixinMenu: async (data: RoleWeixinMenuVO) => {
    return await request.post({ url: `/system/role-weixin-menu/create`, data })
  },

  // 修改微信菜单和角色关联
  updateRoleWeixinMenu: async (data: RoleWeixinMenuVO) => {
    return await request.put({ url: `/system/role-weixin-menu/update`, data })
  },

  // 删除微信菜单和角色关联
  deleteRoleWeixinMenu: async (id: number) => {
    return await request.delete({ url: `/system/role-weixin-menu/delete?id=` + id })
  },

  // 导出微信菜单和角色关联 Excel
  exportRoleWeixinMenu: async (params) => {
    return await request.download({ url: `/system/role-weixin-menu/export-excel`, params })
  },

  // 新增微信菜单和角色关联
  saveWeinxinMenu: async (data: any) => {
    return await request.post({ url: `/system/role-weixin-menu/saveWeinxinMenu`, data })
  }
}
